package pages;

import ui_tests.TestData;
import utils.Log4Test;

/**
 * Created by gzhovnuvaty on 7/23/14.
 */
public class DetailPage extends GeneralPage {


    public boolean isSignUpPopupIsOpened() {
        Log4Test.info("Verify that 'Sign up' is opened");
        System.out.println(elementIsLocated(getLocator("isSignUpPopupIsOpened")).getText());
        return isTextPresent(TestData.SIGN_UP_TO_VIEW_PRIVATE_GALLERY, "isSignUpPopupIsOpened");
    }

    public DetailPage clickUnlockBtn() {
        Log4Test.info("Click 'Unlock Private Gallery' button on Ad detail page if user has private images");
        elementIsLocated(getLocator("unlockPrivatePhotoBtn")).click();
        return this;


    }


    public LoginPage clickAlreadyMemberBtn() {
        Log4Test.info("Click 'I'm already member' button on 'Sign up' popup");
        System.out.println(elementIsLocated(getLocator("alreadyMemberBtn")).getText());
        elementIsLocated(getLocator("alreadyMemberBtn")).click();
        return new LoginPage();
    }


}
